//
//  Top250Cell.m
//  项目一TimeMovie
//
//  Created by apple on 16/4/5.
//  Copyright © 2016年 huangmingyu. All rights reserved.
//

#import "Top250Cell.h"
#import "StarView.h"

@implementation Top250Cell

- (void)awakeFromNib {
    // Initialization code
    [super awakeFromNib];
    _scoreLabel.alpha = 0.7;
}

- (void)setModel:(TopModel *)model {
    
    _model = model;
    
    //配置cell上显示的内容
    NSString *imgName = _model.imageName[@"medium"];
    
    [_imgView sd_setImageWithURL:[NSURL URLWithString:imgName]];
    
//    _ratingView.backgroundColor = [UIColor clearColor];
//    [_ratingView addSubview:starView];
     // 114 57 20
    _titleLabel.text = _model.title;
    _titleLabel.textColor = [UIColor colorWithWhite:1 alpha:0.6];
    _titleLabel.backgroundColor = [UIColor colorWithWhite:0.2 alpha:0.95];
    [self.contentView bringSubviewToFront:_titleLabel];
    
    
    
    NSNumber *score = _model.rating[@"average"];
    _scoreLabel.text = [NSString stringWithFormat:@"%.1f",[score floatValue]];
    _scoreLabel.textColor = [UIColor colorWithRed:114 / 255.0 green:57 /255.0 blue:20 / 255.0 alpha:1];
    [_ratingView changeStarViewWithRating:[score floatValue]];
    
}

@end
